<?php
	require 'dbConnect.php';

//	$teamNum = 66; //total number of teams + 1

	//populate team proctors
	// $j = 1;
	// for($i=1; $i<66; $i++){
	// 	if($i %10 == 0) {$j++;}
	// 	$str = "Member".$j;
	 	
	// 	$query = "UPDATE teams SET tmproc='$str' WHERE tid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }

	//reset team scores
	// for($i=1; $i<$teamNum; $i++){	 	
	// 	$query = "UPDATE teams SET tmscoreJ='0' WHERE tid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// 	$query = "UPDATE teams SET tmscoreD='0' WHERE tid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// 	$query = "UPDATE teams SET tmscoreF='0' WHERE tid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// 	$query = "UPDATE teams SET tmtotal='0' WHERE tid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());

	// }

	//populate team ids
	// for($i=1; $i<$teamNum; $i++){
	// 	$query = "INSERT INTO teams(tid) values($i)";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error($result));
	// }

	// //populate team names
	// for($i=1; $i<66; $i++){
	// 	$str = "Team ".$i;
	// 	$query = "UPDATE teams SET tmname='$str' WHERE tid=$i";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }
	

	// // populate team totals
	// for($i=1; $i<66; $i++){
	// 	$str = "Team ".$i;
	//  	$query = "SELECT tmscoreJ + tmscoreD + tmscoreF FROM teams WHERE tid=$i";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// 	$row = mysql_fetch_row($result);
		
	// 	$score = $row[0];
	// 	$query = "UPDATE teams SET tmtotal='$score' WHERE tid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }

	

	// //populate proc ids
	// for($i=1; $i<11; $i++){
	// 	$query = "INSERT INTO proctors(pid) values($i)";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error($result));

	// // populate proctors name
	// for($i=1; $i<11; $i++){
	// 	$str = "Member".$i;
	 	
	// 	$query = "UPDATE proctors SET procname='$str' WHERE pid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }

	// // populate proctors pass 
	// for($i=1; $i<11; $i++){
	// 	$str = md5("Member".$i);	 	
	// 	$query = "UPDATE proctors SET procpass='$str' WHERE pid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }

	// // // populate proctors name
	// for($i=1; $i<11; $i++){
	// 	$str = "Member".$i;
	 	
	// 	$query = "UPDATE proctors SET procname='$str' WHERE pid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }

	// // // populate proctors pass 
	// for($i=1; $i<11; $i++){
	// 	$str = md5("Member".$i);	 	
	// 	$query = "UPDATE proctors SET procpass='$str' WHERE pid=$i";
	//  	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
	// }

	// populate questions
	// for($i=1; $i<21; $i++){
	// 	$qid = "J".$i;
	// 	$query = "INSERT INTO question(qid) values('$qid')";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error($result));
	// }
	
		// $query = "INSERT INTO question(qid) values('F01')";
	 // 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());
		// $query = "INSERT INTO question(qid) values('JJ1')";
	 // 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error());

	// $points = 10;
	// $ptCtr = 0;
	// for($i=1; $i<21; $i++){
	// 	if($ptCtr % 5 == 0) { $points += 10; $ptCtr++; }
	// 	$qid = "J".$i;
	// 	$quest = "Jora na yan.";
	// 	$query = "UPDATE question SET question='$quest' WHERE qid=$qid";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error($result));
	// }

	// $ptCtr = 0;
	// $points = 20;
	// for($i=1; $i<21; $i++){
	// 	if($ptCtr % 5 == 0) { $points += 20; $ptCtr++; }
	// 	$qid = "D".$i;
	// 	$query = "INSERT INTO questions(qid, question, answer, points, categ, image, round ) values($qid, 'Jora na yan.', 'Sinech itey?', '$points', 'Da Hu', '../images/dummy1.jpg', 'DJeopardy')";
	// 	$result = mysql_query($query, $connection) or die("Error in query: $query." .mysql_error($result));
	// }

	// $query = "INSERT INTO questions(qid, question, answer, points, categ, image, round ) values('F01', 'Jora na yan.', 'Sinech itey?', '$points', 'Da Hu', '../images/dummy1.jpg', 'FJeopardy')";
	// $query = "INSERT INTO questions(qid, question, answer, points, categ, image, round ) values('JJ1', 'Jora na yan.', 'Sinech itey?', '$points', 'Da Hu', '../images/dummy1.jpg', 'JJeopardy')";


?>
